package com.dotflat.physicalevaluate.repository;

import com.dotflat.physicalevaluate.domain.importexport.PhysicEvaluateImportRecord;
import com.dotflat.physicalevaluate.domain.pe.PERecord;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

public interface RecordRepository extends JpaRepository<PERecord, String>, JpaSpecificationExecutor<PERecord> {

//    PERecord getOneByCreateTeacherIdAndIdAndDeletedIsFalse(String staffId, String recordId);

    PERecord findFirstByAreaIdAndIdAndDeletedIsFalse(String areaId, String recordId);

    PERecord getOneByChildrenIdAndImportRecordAndFinishedIsFalseAndDeletedIsFalse(String childrenId, PhysicEvaluateImportRecord importRecord);

//    Page<PERecord> findAllByCreateTeacherIdAndChildrenIdAndFinishedIsTrueAndDeletedIsFalseOrderByCreatedDesc(String staffId, String childrenId, Pageable pageable);
    Page<PERecord> findAllByAreaIdAndChildrenIdAndFinishedIsTrueAndDeletedIsFalseOrderByCreatedDesc(String areaId, String childrenId, Pageable pageable);

}